home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / misc-part2 / 11206 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: mail2news.demon.co.uk!girvan.demon.co.uk
  2. From: Allan Girvan <allan@girvan.demon.co.uk>
  3. Newsgroups: comp.sys.amiga.misc
  4. Subject: Re: Amigados - checking for a file
  5. Date: Sat, 6 Apr 96 02:09:44 GMT
  6. Message-ID: <9604060209.AA00113@girvan.demon.co.uk>
  7. References: <401.6670T240T431@nibelung.demon.co.uk>
  8. X-NNTP-Posting-Host: girvan.demon.co.uk
  9. X-Newsreader: ADMaN 1.7 Copyright 1995 S.T.Brown
  10. X-Mail2News-Path: disperse.demon.co.uk!post.demon.co.uk!girvan.demon.co.uk
  11.  
  12. On Sat, 06 Apr 96, Barry Shilliday wrote:
  13.  
  14. > What would be the format to check the existence of a file in a script for dos?
  15. > I would have thought something like this:
  16. > If EXISTS blah:filename
  17. >   dowhatever
  18. >   else
  19. >    dothatinstead
  20. >    endif
  21. > endif
  22. > but this doesn't work.
  23.  
  24. You've got one "endif" too many there! Try deleting the first one.
  25.  
  26. This works:-
  27.  
  28.  
  29.  
  30. .key file
  31. If exists <file>
  32.     echo "Found it"
  33.      else
  34.     echo "No trace"
  35. endif
  36.  
  37.  
  38.  
  39. It takes the filename as an argument.
  40.  
  41. Cheers,
  42.  
  43.  
  44. Allan.
  45. -- 
  46.  |  EMail - allan@girvan.demon.co.uk  |  Running on    //  You Know it  |
  47.  |  Greetings from Glasgow, Scotland  |  AMIGA 1200  \X/   makes sense  |
  48.